package com.zking.ssm.NH.controller;

import com.zking.ssm.NH.model.SysMenu;
import com.zking.ssm.NH.service.ISysMenuService;
import com.zking.ssm.util.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Description
 * @Author NH
 * @Date 2021/1/19/0019 19:40
 */

@Controller
@RequestMapping("/admin")
public class SysMenuController {

    @Autowired
    private ISysMenuService sysMenuService;

    @RequestMapping("/listAll")
    @ResponseBody
    public JsonData list(SysMenu menu) {

        JsonData jsonData = new JsonData();
        List<SysMenu> menuList = sysMenuService.menuList(menu);
        jsonData.setCode(0);
        jsonData.setResult(menuList);
        jsonData.setResult2(menu.getNodes());

        jsonData.setMessage("查询成功");
        return jsonData;
    }

}
